const { setProduction } = require('leancloud-storage');
const Comparator = require('../../utils/Comparator');

module.exports = class Sort {
  constructor(originalCallbacks) {
    this.callbacks = Sort.initSortingCallbacks(originalCallbacks);
    this.comparator = new Comparator(this.callbacks.compareCallback);
  }
  static initSortingCallbacks(originalCallbacks) {
    const callbacks = originalCallbacks || {};
    const stubCallback = () => {};

    callbacks.visitingCallback = callbacks.visitingCallback || stubCallback;
    callbacks.compareCallback = callbacks.compareCallback || undefined;

    return callbacks;
  }
  sort() {
    throw new Error('必须实现sort方法');
  }
}